package cn.zdm.demo2.auth.controller;

import cn.zdm.demo2.auth.model.dto.IosAuthExportDTO;
import cn.zdm.demo2.auth.model.dto.IosAuthImportDTO;
import cn.zdm.demo2.auth.service.FileOptService;
import cn.zdm.demo2.common.result.ResultObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * copyright (C), 2021, 武大吉奥科技有限公司
 *
 * @Program demo2
 * @Description 文件上传下载控制器
 * @Author ZhaoDeman
 * @Create 2021/1/27 17:42
 * @Version 1.0.0
 * <author>                <time>                  <version>                   <description>
 * ZhaoDeman        2021/1/27 17:42                 1.0                        文件上传下载控制器
 */
@Api(tags = "文件导入导出上传下载测试模块")
@RestController
@RequestMapping("/test/file")
public class FileOptController {

    @Autowired
    private FileOptService fileOptService;

    @ApiOperation(value = "文件导出")
    @GetMapping("/export")
    public void export(@RequestBody IosAuthExportDTO iosAuthExportDTO) {
        fileOptService.export(iosAuthExportDTO);
        return;
    }

    @ApiOperation(value = "文件导入")
    @PostMapping(value = "/import")
    public ResultObject<Object> importFile(@RequestBody IosAuthImportDTO iosAuthImportDTO) {
        return fileOptService.importFile(iosAuthImportDTO);
    }
}
